<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Insert title here</title>

<script src="//cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.js"></script>
<style>
</style>
<script>
</script>

</head>
<body>
<%=application.getRealPath("/") %>
<br>
<%!
int counter = 0; 
public void jspInit() {
	counter = 3000;
    System.out.print("容器初始化（web container is initlizing.）");
}

%>

<%!
public void jspDestroy() {
    counter = 3000;
    // TODO: 把所有网站访问记录写入文件
    System.out.print("容器正在准备关闭（web container is shuting down.）");
}

%>

<%
//　简单类型和复合类型的拆箱与装箱
// Integer 对象 转变成 int 拆箱
// int 转变成 Integer 是装箱
counter++;
application.setAttribute("count", new Integer(counter));
%>
网站访问量是<%=counter %>
</body>
</html>